PXC Documentation

PXC Home

Blend

pre 1.18

Blend 2 images using different blend modes.



Node Data

FilterComposeArray

Display name

Blend

Internal name

Node_Blend

Inheritances

node
node_processor
node_blend

Inputs

node_blend

surface

Background

surface

Foreground

enum

Blend Mode

float

Opacity

surface

Mask

enum

Fill Mode

enum

Output Dimension

vec2

Constant Dimension

bool

Active

bool

Preserve Alpha

enum

Horizontal Align

enum

Vertical Align

bool

Invert Mask

float

Mask Feather

vec2

Position

Outputs

node_blend

surface

Surface Out

Blending surfaces is a fundamental step in any VFX process. Blend node allows you to combine 2 surfaces under different blend mode.



Blend Modes


Blend Mode control how the surface is being mixed. Blend modes available in the this node are:


The examples are blend of 2 surfaces:



Mode Operation Example
Normal $$C_{out} = C_{fg}C_{fg.a} + C_{bg}(1-C_{fg.a})$$
Add $$C_{out} = C_{fg} + C_{bg}$$
Subtract $$C_{out} = C_{fg} - C_{bg}$$
Multiply $$C_{out} = C_{fg}C_{bg}$$
Screen $$C_{out} = 1 - (1-C_{fg})(1-C_{bg})$$
Overlay $$C_{out} = \begin {cases} 2C_{fg}C_{bg} & C_{fg} < 0.5 \\ 1 - 2(1-C_{fg})(1-C_{bg}) & C_{fg} \ge 0.5 \end {cases}$$
Hue Transfer the hue of the foreground to the background
Saturation Transfer the saturation of the foreground to the background
Luminosity Transfer the luminosity of the foreground to the background
Maximum $$C_{out} = max(C_{fg}, C_{bg})$$
Minimum $$C_{out} = min(C_{fg}, C_{bg})$$
Replace $$C_{out} = C_{fg}$$
Difference $$C_{out} = |C_{fg} - C_{bg}|$$

Opacity


The intensity of the effect will be multiply by the Opacity property.


Preserve Alpha


Blend operation apply to all channel including alpha channel. Which mean some operation may erase the alpha channel of the original image. To exclude the alpha calculation, set Preserve Alpha to true.



Dimension Mixing


When blending surfaces of different sizes. You can set the blending behaviour using several properties:


Filling


The Fill Mode property control the behaviour of the smaller surface.


Mode Description
None Do nothing, place smaller surface directly.
Stretch Stretch the smaller surface to fit the larger surface.
Tile Tile the smaller surface to fit the larger surface.

Alignment


When Fill Mode is set to None, you can move the foreground freely in the preview panel.